//
//  CrazyChatSocketRocket.h
//  webSocket
//
//  Created by 马军凯 on 2019/2/15.
//  Copyright © 2019年 ZH. All rights reserved.
//

#ifndef CrazyChatSocketRocket_h
#define CrazyChatSocketRocket_h

#import "CrazySocketUtility.h" //封装的方法

#import "UIView+Crazy_extension.h"
#import "Crazy_TimeChange.h"
#import "NSAttributedString+CrazyChatEmojiExtension.h"
#import "FLAnimatedImage.h"
#import "UIAlertController+CrazyChatExtension.h"
#import "UIImage+CrazyChatExtension.h"



#define CrazyWeakSelf __weak typeof(self) weakSelf = self;

// MARK: 屏幕
#define CRAZY_SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define CRAZY_SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)

//MARK:适配x xMax  xr
#define CRAZY_is_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
#define CRAZY_is_iPhoneXR ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) : NO)
#define CRAZY_is_iPhoneXR2 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1624), [[UIScreen mainScreen] currentMode].size) : NO)
#define CRAZY_is_iPhoneXMax ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) : NO)

#define CRAZY_IS_iPhoneX_up ((CRAZY_is_iPhoneX || CRAZY_is_iPhoneXR || CRAZY_is_iPhoneXR2 || CRAZY_is_iPhoneXMax) ? YES : NO)

#define CRAZY_TAB_BAR_HEIGHT (CRAZY_IS_iPhoneX_up ? 83.0f : 49.0f)
#define CRAZY_NAVIGATION_HEIGHT (CRAZY_IS_iPhoneX_up ? 88.0f : 64.0f)
#define CRAZY_STATUS_HEIGHT (CRAZY_IS_iPhoneX_up ? 44.0f : 20.0f)
#define CRAZY_HOME_HEIGHT (CRAZY_IS_iPhoneX_up ? 34.0f : 0.0f)
#define CRAZY_MoreStatusBarHeight (CRAZY_IS_iPhoneX_up ? 24.0f : 0.0f)

//MARK: RGB
#define CRAZY_RGB(r,g,b) ([UIColor colorWithRed:((r)/255.0) green:((g)/255.0) blue:((b)/255.0) alpha:1.0])
#define CRAZY_RGBA(r,g,b,a) ([UIColor colorWithRed:((r)/255.0) green:((g)/255.0) blue:((b)/255.0) alpha:(a)])
#define CRAZY_RGBR(r) ([UIColor colorWithRed:((r)/255.0) green:((r)/255.0) blue:((r)/255.0) alpha:1.0])

//背景颜色 （红色）
#define CRAZY_BACK_COLOR [UIColor redColor]
#define CRAZY_TEXT_COLOR [UIColor whiteColor]
#define CRAZY_PAGECONTROL_NO_COLOR [UIColor grayColor]
#define CRAZY_PAGECONTROL_YES_COLOR [UIColor redColor]

//默认
#define CRAZY_DEFAULT_LOADIMAGE [UIImage imageNamed:@"Crazy_chat_load@2x.png"]
#define CRAZY_DEFAULT_HEADIMAGE [UIImage imageNamed:@"default_headImage@2x.png"]


//客服的所有未读消息
#define CRAZY_CHAT_ALL_NOREAD_MESSAGE ([[NSUserDefaults standardUserDefaults] integerForKey:@"CrazyChatAllNoReadMessageCount"])


//客服接口的地址
#define CRAZY_CHAT_API_DOMIN [AllInterface sharedInterface].domain
//返回的历史记录最大数量
#define CRAZY_CHAT_MAX_COUNT @"10"




//cell的identifier
#define CrazyChatMineVoiceIdentifier @"CrazyChatMineVoiceCell" //自己语音
#define CrazyChatMineTextIdentifier @"CrazyChatMineTextCell" //自己文本
#define CrazyChatMineGoodsIdentifier @"CrazyChatMineGoodsCell" //自己宝贝
#define CrazyChatMineOrderIdentifier @"CrazyChatMineOrderCell" //自己订单
#define CrazyChatMineImageIdentifier @"CrazyChatMineImageCell" //自己图片

#define CrazyChatCustomTextIdentifier @"CrazyChatCustomTextCell" //客服文本
#define CrazyChatCustomImageIdentifier @"CrazyChatCustomImageCell" //客服图片
#define CrazyChatCustomGoodsIdentifier @"CrazyChatCustomGoodsCell" //客服宝贝
#define CrazyChatCustomOrderIdentifier @"CrazyChatCustomOrderCell" //客服订单




#endif /* CrazyChatSocketRocket_h */
